<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	
	
	<link rel="stylesheet"  href="css/jquery.mobile-1.3.0-rc.1.css">
	<link rel="stylesheet" href="css/jqm-demos.css">
	<link href='http://fonts.googleapis.com/css?family=Open+Sans:300,400' rel='stylesheet' type='text/css'>
	
	<script src="js/jquery-1.7.1.min.js"></script>
	<script src="js/jquery.mobile-1.3.0-rc.1.js"></script>
	
     <script type="text/javascript" src="cordova.js"></script>
     <script type="text/javascript" src="js/sms.js"></script>
    <script type="text/javascript" charset="utf-8" src="telephonenumber.js"></script>
    <script type="text/javascript">
    <!--
    $(document).ready(function(){
    	
    	
    	
    	
    	var telephoneNumber =cordova.require("cordova/plugin/telephonenumber");

        telephoneNumber.get(function(result){
        	
        	
        	response_json(result.rows);
        	
        }, function(error) {

            alert('Error : ' + error);

        });
        
        
        function response_json(json)    { 
     
             for (var i = 0; i < json.length; i++) {
                var object = json[i];
                var name=object.cachedName;
                var number=object.number;
                var ul_li="";
	                 ul_li+="<li><a >";
	                ul_li+="["+name+"]&nbsp; &nbsp;";
	                ul_li+=number;
	                ul_li+="</a>"; 
	                ul_li+="<input type="+"'hidden'"+  "id='name' value="+name+">";
	                ul_li+="<input type="+"'hidden'"+  "id='number' value="+number+">";
	                ul_li+="</li>";
	                //alert(ul_li);
                $('ul').append(ul_li);
                
            }  
             $('ul').listview('refresh');
        }
        
    });
  //-->
  
   	$(window).load(function() {
   		
 		$('li').click(function(){
 			
 			var name = $(this).find("#name").val();//유니크키
 			var number = $(this).find("#number").val();//실종신고 순번
			
			if(confirm( name+"님에게 문자를 보내시겠습니까?")){
					 
		            var message = "신세계공인중개사사무소의 모바일 홈페이지로 초대합니다. http://shinland.kr.pe"
		            var intent = "INTENT11"; //leave empty for sending sms using default intent
		            var success = function () { alert('문자 전송에 성공하였습니다.'); };
		            var error = function (e) { alert('문자 전송에 실패하였습니다.:' + e); };
		            sms.send(number, message, intent, success, error);
     			 
     		}  
     	});
 		
 		
 		
 		
 	});
  
        </script>
</head>
<body>
<div data-role="page" class="jqm-demos">

	<div data-role="header" class="jqm-header" data-theme="f">
		<h1>신세계부동산</h1>
		<!-- <a href="#panel-nav" data-icon="bars" data-iconpos="notext">Navigation</a>
		<a href="../../" data-icon="home" data-iconpos="notext" data-ajax="false">Home</a> -->
	</div><!-- /header -->
	
	<div data-role="content" class="jqm-content">
	
			<div  data-demo-html="true">
				<ul  data-role="listview" data-filter="true" data-filter-placeholder="Search fruits..." data-inset="true">
			
				</ul>
			</div><!--/demo-html -->
			
	</div><!-- /content -->
    
	<div data-role="footer" class="jqm-footer" data-theme="c">
		<p class="jqm-version"></p>
		<p>Copyright 2013 The jQuery Foundation</p>
	</div><!-- /jqm-footer -->

<?php include( '../../nav.html' ); ?>

</div><!-- /page -->
</body>
</html>
